package com.smarttiger.zero.admin.dto;

import com.smarttiger.zero.admin.entity.InterfaceModel;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhouzhengwei on 2021/10/5.
 */
public class InterfaceDto extends BaseDto {

    private String name;

    private String protocol;

    private String isAlive;

    private String note;

    private String example;

    private String code;

    static public InterfaceDto tranlate(InterfaceModel f){
        InterfaceDto t = new InterfaceDto();
        BeanUtils.copyProperties(f,t,"logicModels","argsModels");
        return t;
    }
    static public List<InterfaceDto> tranlateList(List<InterfaceModel> f){
        List<InterfaceDto> t = new ArrayList<>();
        f.forEach(e->{
            InterfaceDto dto = InterfaceDto.tranlate(e);
            t.add(dto);
        });
        return t;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public String getIsAlive() {
        return isAlive;
    }

    public void setIsAlive(String isAlive) {
        this.isAlive = isAlive;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getExample() {
        return example;
    }

    public void setExample(String example) {
        this.example = example;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
